/* 
 * File:   Real.h
 * Author: Gab'z
 *
 * Created on 29 mai 2012, 12:26
 */

#ifndef REAL_H
#define	REAL_H

#include "SimpleNumber.h"

namespace calculator {
    class Integer;
    class Rationnal;

    class Real : public SimpleNumber {
    public:
        Real(double x);
        Real(const Real& orig);
        Real(const Integer& integer);
        Real(const Rationnal& rationnal);

        virtual ~Real();
        Real* clone() const;

        std::string toString() const;
        double value() const;

        Real& operator=(const Real& real);
        Real& operator+=(const Real& real);
        Real& operator-=(const Real& real);
        Real& operator*=(const Real& real);
        Real& operator/=(const Real& real);
        Real& pow(const SimpleNumber& sn);

    private:
        double _x;
    };
    Real operator+(const Real& r1, const Real& r2);
    Real operator-(const Real& r1, const Real& r2);
    Real operator*(const Real& r1, const Real& r2);
    Real operator/(const Real& r1, const Real& r2);
    Real pow(const Real& r1, const SimpleNumber& sn);

}

#endif	/* REAL_H */

